package com.bizmerce.ebms.engine.ebms;

import java.io.FileInputStream;

import javax.xml.namespace.QName;
import javax.xml.soap.AttachmentPart;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPHeader;
import javax.xml.soap.SOAPMessage;

public class TEst {

	public static void main(String[] args) throws Exception {
		MessageFactory messageFactory = MessageFactory.newInstance();
		
		SOAPMessage soapMessage = messageFactory.createMessage();
		AttachmentPart payload = soapMessage.createAttachmentPart();
		payload.setRawContent(new FileInputStream("d:/sample.xml"), "text/xml");
		
		SOAPHeader header =  soapMessage.getSOAPHeader();
		
		SOAPElement ebMessageHeaderelement = header.addChildElement(new QName("http://test", "MessageHeader", "eb"));
		System.out.println(ebMessageHeaderelement.getClass());
	}
}
